﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Quanlynhasach.hethongxuly;
using System.Data;

namespace Quanlynhasach.hethongluutru
{
    class UserDAO
    {
        public static bool KiemTraNguoiDung(UserDTO nd)
        {
            string sqlString = "select * from ThanhVien where User='" + nd.User + "' and Password='" + nd.Password + "'and Quyen='"+nd.PhanQuyen+"'";
            DataTable dt = database.ExcuQuery(sqlString);
            if (dt.Rows.Count != 0)
            {
                return true;
            }
            else
            {
                return false;
            }

        }
        public DataTable LayDanhSachNguoiDung()
        {
            string sqlString = "select * from ThanhVien";
            return database.ExcuQuery(sqlString);
        }
    }
}
